.\"
.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
.\" permission to reproduce portions of its copyrighted documentation.
.\" Original documentation from The Open Group can be obtained online at
.\" http://www.opengroup.org/bookstore/.
.\"
.\" The Institute of Electrical and Electronics Engineers and The Open
.\" Group, have given us permission to reprint portions of their
.\" documentation.
.\"
.\" In the following statement, the phrase ``this text'' refers to portions
.\" of the system documentation.
.\"
.\" Portions of this text are reprinted and reproduced in electronic form
.\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
.\" Standard for Information Technology -- Portable Operating System
.\" Interface (POSIX), The Open Group Base Specifications Issue 6,
.\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
.\" Engineers, Inc and The Open Group.  In the event of any discrepancy
.\" between these versions and the original IEEE and The Open Group
.\" Standard, the original IEEE and The Open Group Standard is the referee
.\" document.  The original Standard can be obtained online at
.\" http://www.opengroup.org/unix/online.html.
.\"
.\" This notice shall appear on any product containing this material.
.\"
.\" The contents of this file are subject to the terms of the
.\" Common Development and Distribution License (the "License").
.\" You may not use this file except in compliance with the License.
.\"
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
.\" or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions
.\" and limitations under the License.
.\"
.\" When distributing Covered Code, include this CDDL HEADER in each
.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
.\" If applicable, add the following below this CDDL HEADER, with the
.\" fields enclosed by brackets "[]" replaced with your own identifying
.\" information: Portions Copyright [yyyy] [name of copyright owner]
.\"
.\"
.\" Copyright 1989 AT&T
.\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
.\" Copyright (c) 2000, Sun Microsystems, Inc.  All Rights Reserved
.\"
.TH TALK 1 "Nov 6, 2000"
.SH NAME
talk \- talk to another user
.SH SYNOPSIS
.LP
.nf
\fBtalk\fR \fIaddress\fR [\fIterminal\fR]
.fi

.SH DESCRIPTION
.sp
.LP
The \fBtalk\fR utility is a two-way, screen-oriented communication program.
.sp
.LP
When first invoked, \fBtalk\fR sends a message similar to:
.sp
.in +2
.nf
Message from TalkDaemon@ \fIher_machine\fR at \fItime .\|.\|.\fR
talk: connection requested by \fIyour_address\fR
talk: respond with: talk \fIyour_address\fR
.fi
.in -2
.sp

.sp
.LP
to the specified \fIaddress\fR. At this point, the recipient of the message can
reply by typing:
.sp
.in +2
.nf
talk \fIyour_address\fR
.fi
.in -2
.sp

.sp
.LP
Once communication is established, the two parties can type simultaneously,
with their output displayed in separate regions of the screen. Characters are
processed as follows:
.RS +4
.TP
.ie t \(bu
.el o
Typing the alert character will alert the recipient's terminal.
.RE
.RS +4
.TP
.ie t \(bu
.el o
Typing Control-L will cause the sender's screen regions to be refreshed.
.RE
.RS +4
.TP
.ie t \(bu
.el o
Typing the erase and kill characters will affect the sender's terminal in the
manner described by the \fBtermios\fR(3C) interface.
.RE
.RS +4
.TP
.ie t \(bu
.el o
Typing the interrupt or end-of-file (\fBEOF\fR) characters will terminate the
local \fBtalk\fR utility. Once the \fBtalk\fR session has been terminated on
one side, the other side of the \fBtalk\fR session will be notified that the
\fBtalk\fR session has been terminated and will be able to do nothing except
exit.
.RE
.RS +4
.TP
.ie t \(bu
.el o
Typing characters from \fBLC_CTYPE\fR classifications \fBprint\fR or
\fBspace\fR will cause those characters to be sent to the recipient's terminal.
.RE
.RS +4
.TP
.ie t \(bu
.el o
When and only when the \fBstty\fR \fBiexten\fR local mode is enabled,
additional special control characters and multi-byte or single-byte characters
are processed as printable characters if their wide character equivalents are
printable.
.RE
.RS +4
.TP
.ie t \(bu
.el o
Typing other non-printable characters will cause them to be written to the
recipient's terminal as follows: control characters will appear as a caret
(\|\fB^\fR\|) followed by the appropriate \fBASCII\fR character, and characters
with the high-order bit set will appear in "meta" notation. For example,
`\fB\e003\fR\&' is displayed as `\fB^C\fR' and `\fB\e372\fR\&' as
`\fBM\(miz\fR'.
.RE
.sp
.LP
Permission to be a recipient of a \fBtalk\fR message can be denied or granted
by use of the \fBmesg\fR(1) utility. However, a user's privilege may further
constrain the domain of accessibility of other users' terminals. Certain
commands, such as \fBpr\fR(1), disallow messages in order to prevent
interference with their output. \fBtalk\fR will fail when the user lacks the
appropriate privileges to perform the requested action.
.sp
.LP
Certain block-mode terminals do not have all the capabilities necessary to
support the simultaneous exchange of messages required for \fBtalk\fR. When
this type of exchange cannot be supported on such terminals, the implementation
may support an exchange with reduced levels of simultaneous interaction or it
may report an error describing the terminal-related deficiency.
.SH OPERANDS
.sp
.LP
The following operands are supported:
.sp
.ne 2
.na
\fB\fIaddress\fR\fR
.ad
.RS 12n
The recipient of the \fBtalk\fR session. One form of \fIaddress\fR is the
\fIusername\fR, as returned by the \fBwho\fR(1) utility. If you wish to talk to
someone on your own machine, then \fIusername\fR is just the person's login
name. If you wish to talk to a user on another host, then \fIusername\fR is one
of the following forms:
.sp
.in +2
.nf
\fIhost\fR\fB!\fR\fIuser\fR
\fIhost\fR\fB\&.\fR\fIuser\fR
\fIhost\fR\fB:\fR\fIuser\fR
\fIuser\fR\fB@\fR\fIhost\fR
.fi
.in -2
.sp

although \fIuser\fR\fB@\fR\fIhost\fR is perhaps preferred.
.RE

.sp
.ne 2
.na
\fB\fIterminal\fR\fR
.ad
.RS 12n
If the recipient is logged in more than once, \fIterminal\fR can be used to
indicate the appropriate terminal name. If \fIterminal\fR is not specified, the
\fBtalk\fR message will be displayed on one or more accessible terminals in use
by the recipient. The format of \fIterminal\fR will be the same as that
returned by  \fBwho\fR.
.RE

.SH ENVIRONMENT VARIABLES
.sp
.LP
See \fBenviron\fR(7) for descriptions of the following environment variables
that affect the execution of \fBtalk\fR: \fBLANG\fR, \fBLC_ALL\fR,
\fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
.sp
.ne 2
.na
\fB\fBTERM\fR\fR
.ad
.RS 8n
Determine the name of the invoker's terminal type.  If this variable is unset
or null, an unspecified terminal type will be used.
.RE

.SH EXIT STATUS
.sp
.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 6n
Successful completion.
.RE

.sp
.ne 2
.na
\fB\fB>0\fR\fR
.ad
.RS 6n
An error occurred, or \fBtalk\fR was invoked on a terminal incapable of
supporting it.
.RE

.SH FILES
.sp
.ne 2
.na
\fB\fB/etc/hosts\fR\fR
.ad
.RS 18n
host name database
.RE

.sp
.ne 2
.na
\fB\fB/var/adm/utmpx\fR\fR
.ad
.RS 18n
user and accounting information for \fBtalk\fR
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Standard
.TE

.SH SEE ALSO
.sp
.LP
.BR mail (1),
.BR mesg (1),
.BR pr (1),
.BR stty (1),
.BR who (1),
.BR write (1),
.BR termios (3C),
.BR attributes (7),
.BR environ (7),
.BR standards (7)
.SH NOTES
.sp
.LP
Typing Control-L redraws the screen, while the erase, kill, and word kill
characters will work in \fBtalk\fR as normal. To exit, type an interrupt
character. \fBtalk\fR then moves the cursor to the bottom of the screen and
restores the terminal to its previous state.
